Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fat Jar Support #26

Open
wants to merge 30 commits into
base: main
Choose a base branch
from
Open

Fat Jar Support #26

wants to merge 30 commits into from

Conversation

mageddo
Copy link

@mageddo mageddo commented Mar 7, 2023

Hey, I've created a new feature that I need in my use case which is:

Created a new feature at LibraryLoader so it will try to load the dll from inside the jar, it's useful so people don't need to worry about specifying paths and handling dll files.

I'm sharing my code in this pull request because with that we aren't too far to be able to create an automated continuous delivery to publish jacob dependency to maven central with the dll bundled, if you consider to merge this pull request then I can work to fix the issue #4 .

See another side features or fixes that I needed to achieve my objective:

  1. Automated the java build with gradle which is capable to automatically run the junit tests and genrated the versioned jar.
  2. I found that some files were with different encodings (utf16 and windows-1252) then they broken the build process, fixed that
  3. Realized some tests are dependent on a specific environment installed tools, like excel or word, so named them as ManualTest this way we can run them separatelly when wanted but they won't run on default build process.

You can check the results of this pull request by typing:

$ ./gradlew build
BUILD SUCCESSFUL in 53s

$ dir build\libs
 Directory of G:\dev\jacob-project\build\libs

03/07/2023  01:45 AM    <DIR>          .
03/07/2023  01:45 AM    <DIR>          ..
03/07/2023  01:45 AM           243,244 jacob-project-1.21.jar
               1 File(s)        243,244 bytes
               2 Dir(s)  244,545,708,032 bytes free

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't want binaries in the source tree

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't want binaries in the source tree

@freemansoft
Copy link
Owner

freemansoft commented Jul 25, 2023

  1. Why did you rename the tests to be ManualTest. What are you trying to say with that? -
    1. Ah I see that in your comments
  2. How does the build process change? The current build process is ANT driven. Are you totally replacing the Ant process with gradle?
    1. Ah I see some of that in your comments.
  3. None of the README files were updated to document the new build process.

@freemansoft
Copy link
Owner

freemansoft commented Mar 26, 2024

It looks like the gradle code builds the package but not the DLLs. So this is a partial build.

Some of the samples were in different character sets because they were part of defect reports related to character sets. A quick check makes it look like the source code is all UTF-8 CRLF.

The DLL is loaded by copying it from the jar file into a temporary file system. That is a slick way to work with a single bundle but I'm not sure relying on a temp file to load a DLL is a good idea. Feels like a security issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants